﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace OnlineEducation.Data.Entities
{
    /// <summary>
    /// 课时/课程
    /// </summary>
    /// <seealso cref="OnlineEducation.Data.Entities.EntityBase" />
    public class Lesson : EntityBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [ForeignKey("Course")]
        public int CourseId { get; set; }
        public Course Course { get; set; }

        [Display(Name = "序号")]
        [Required(ErrorMessage = "序号不能为空")]
        public int Sequence { get; set; }

        [Display(Name = "标题")]
        [Required(ErrorMessage = "标题不能为空")]
        [StringLength(100, ErrorMessage = "长度不能超过100")]
        public string Title { get; set; }

        [Display(Name = "时长(分钟)")]
        [Required]
        public int Duration { get; set; }

        [Display(Name = "章")]
        [StringLength(100, ErrorMessage = "长度不能超过100")]
        public string Chapter { get; set; }

        [Display(Name = "节")]
        [StringLength(100, ErrorMessage = "长度不能超过100")]
        public string Section { get; set; }

        [Display(Name = "描述")]
        [StringLength(200, ErrorMessage = "长度不能超过200")]
        public string Description { get; set; }

        [Display(Name = "预习")]
        [StringLength(400, ErrorMessage = "长度不能超过400")]
        public string PreviewMaterialURLs { get; set; }

        [Display(Name = "教材")]
        [StringLength(400, ErrorMessage = "长度不能超过400")]
        public string MaterialURLs { get; set; }//PPT，word，pdf 

        [Display(Name = "作业")]
        [StringLength(5000, ErrorMessage = "长度不能超过5000")]
        public string Homework { get; set; }

        [Display(Name = "状态")]
        public int Status { get; set; }
      
    }
}
